package gpstools.track.addons;

import java.io.Serializable;
import java.util.Collections;
import java.util.Map;

public class Source implements Serializable {
	private static final long serialVersionUID = 1L;

	private final String name;
	private final SourceType type;
	private final Map<String, String> properties;

	public Source(String name, SourceType type, Map<String, String> properties) {
		this.name = name;
		this.type = type;
		this.properties = properties;
	}

	public Source(String name, SourceType type) {
		this.name = name;
		this.type = type;
		this.properties = Collections.emptyMap();
	}
	
    public Source(String name) {
        this(name, SourceType.APPLICATION);
    }

    public String getName() {
		return name;
	}

	public SourceType getType() {
		return type;
	}

	public String getProperty(String name) {
		return properties.get(name);
	}

}
